/**
*      author: Y_Yao
*      created: 2025-03-21 17:03:52
**/

#include<bits/stdc++.h>

#define int LL
using namespace std;
using LL = long long;
const LL LLINF = 9e18;
const int INF = 0x3f3f3f3f;
const int N = 2e5 + 7;
int n,m;
vector<pair<int,int>> ans;
vector<vector<int>> edg(N);
int s,t,ds,dt;
int ls[N],lt[N];
int fa[N],sz[N];

int find(int x)
{
    return fa[x] == x ? x : fa[x] = find(fa[x]);
}

bool Union(int u,int v)
{
    u = find(u);
    v = find(v);
    if(u == v) return false;
    if(sz[u] > sz[v]) swap(u,v);
    fa[u] = v;
    sz[v] += sz[u];
    return true;
}

void solve()
{
    cin >> n >> m;
    if(m < n - 1)
    {
        cout << "No" << endl;
        return;
    }
    for(int i = 1;i <= n;i++)
    {
        fa[i] = i;
        sz[i] = 1;
    }
    for(int i = 1;i <= m;i++)
    {
        int u,v;
        cin >> u >> v;
        edg[u].push_back(v);
        edg[v].push_back(u);
    }
    cin >> s >> t >> ds >> dt;
    for(int i = 1;i <= n;i++)//处理无关点
    {
        if(i == s || i == t)continue;
        for(int j = 0;j < edg[i].size();j++)
        {
            if(edg[i][j] == s || edg[i][j] == t) continue;
            if(Union(i,edg[i][j])) ans.push_back({i,edg[i][j]});
        }
    }
    //处理关系
    for(int i = 0;i < edg[s].size();i++)
    {
        if(edg[s][i] == t) continue;
        int fi = find(edg[s][i]);
        ls[fi] = edg[s][i];
    }
    for(int i = 0;i < edg[t].size();i++)
    {
        if(edg[t][i] == s) continue;
        int fi = find(edg[t][i]);
        lt[fi] = edg[t][i];
    }
    //根据关系处理点
    //只于s和t中的一个点相连,必须连上
    for(int i = 1;i <= n;i++)
    {
        if(i == s || i == t)continue;
        if(ls[i] && !lt[i])
        {
            ds--;
            if(Union(s,i)) ans.push_back({s,ls[i]});
        }
        if(!ls[i] && lt[i])
        {
            dt--;
            if(Union(t,i)) ans.push_back({t,lt[i]});
        }
    }
    if(ds < 0 || dt < 0)
    {
        cout << "No" << endl;
        return;
    }
    //与s和t都相连 最好都连上
    for(int i = 1;i <= n;i++)
    {
        if(ls[i] && lt[i])
        {
            if(ds && Union(s,i))
            {
                ds--;
                ans.push_back({s,ls[i]});
            }
            if(dt && Union(t,i))
            {
                dt--;
                ans.push_back({t,lt[i]});
            }
            if(find(s) != find(i) || find(t) != find(i))
            {
                cout << "No" << endl;
                return;
            }
        }
    }
    if(find(s) != find(t))
    {
        bool f = false;
        for(int i = 0;i < edg[s].size();i++)
        {
            if(edg[s][i] == t)
            {
                f = true;
                break;
            }
        }
        if(ds && dt && f)
        {
            Union(s,t);
            ans.push_back({s,t});
        }
        if(!f)
        {
            cout << "No" << endl;
            return;
        }
    }
    if(ans.size() != n - 1)
    {
        cout << "No" << endl;
        return;
    }
    cout << "Yes" << endl;
    for(auto& e : ans)
    {
        cout << e.first << " " << e.second << endl;
    }

}

signed main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);

    int t = 1;
    //cin >> t;
    while(t--)
    {
        solve();
    }
    return 0;
}